import Vue from 'vue'
import Vuex from 'vuex'
Vue.use(Vuex)
let de = '上海' // eslint-disable-line no-unused-vars
try {
  if (localStorage.city) {
    de = localStorage.city
  }
} catch (e) {}
export default new Vuex.Store({
  state: {
    city: localStorage.city || '澜沧'
  },
  // actions: {
  //   changeCity (ctx, city) {
  //     ctx.commit('changeCity', city)
  //   }
  // },
  mutations: {
    changeCity (state, city) {
      state.city = city
      try {
        localStorage.city = city
      } catch (e) {}
    }
  }
})
